<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Executing an ECLiPSe Goal From Tcl
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot030.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot026.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot032.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc53">6.5</A>&nbsp;&nbsp;Executing an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> Goal From Tcl</H2>
An ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> predicate can be invoked from the Tcl side using the
remote ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> predicate call (ec_rpc) facility. This should be the
main method of interacting and communicating with ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> in the remote
interface. Information can be sent to ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> via bindings for (input)
arguments when the call is made; and
results returned from ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> via the bindings made to (output)
arguments:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<A NAME="@default128"></A><B>ec_rpc <I>goal ?format?</I></B><DD CLASS="dd-description"><BR>
Remote ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> predicate call.
 It calls goal in the default module. The goal should be simple
	in the sense that it can only succeed, fail or throw.
 Any choice-points the goal leaves will be discarded.<BR>
<BR>
	Calls to <B>ec_rpc</B> can be nested
	and can be used from within Tcl queue event handlers. However, an
	<B>ec_rpc</B> cannot be issued while ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side has control.<BR>
<BR>
	If no format argument is given, the goal is assumed to be in
	ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> syntax. If a <I>format</I> argument is provided,
	the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> goal is constructed from <I>goal</I> and <I>format</I>,
	according to the conversion rules explained in section <A HREF="embroot024.html#secexdrtcl">5.8</A>.<BR>
<BR>
On success, <B>ec_rpc</B> returns the (possibly more instantiated)
	goal as a Tcl data structure (in EXDR format), otherwise "fail" or 
 "throw" respectively.
</DL>
<HR>
<A HREF="embroot030.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot026.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot032.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
